package com.chq.demo.controller;

import com.chq.demo.model.admin.user.UserModel;
import com.chq.demo.service.admin.UserService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 对外提供获取当前用户接口
 *
 * @author Administrator
 */
@RestController
@RequestMapping("user")
public class UserController {
    @Reference
    public UserService userService;


    @GetMapping("getByName")
    public UserModel getByName() {
        System.out.println(new BCryptPasswordEncoder().encode("111111"));
        return userService.selectByUserName("zhangjian");
    }
}
